package cn.bearspark.collect.provider.rpc;

import cn.bearspark.collect.provider.service.CollectService;
import cn.bearspark.collect.rpc.CollectRpc;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Component;

/**
 * @author f
 */
@Component
@DubboService
public class CollectRpcImpl implements CollectRpc {

    private final CollectService collectService;

    public CollectRpcImpl(CollectService collectService) {
        this.collectService = collectService;
    }

    @Override
    public boolean collect(long userId, int moduleCode, long moduleDataId, int collected) {
        return collectService.collect(userId, moduleCode, moduleDataId, collected);
    }

    @Override
    public boolean isCollected(long userId, int moduleCode, long moduleDataId) {
        return collectService.isCollected(userId, moduleCode, moduleDataId);
    }
}
